package com.telit.android.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * app_patrol_track
 * @author 巡护表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "AppPatrolTrack", description = "AppPatrolTrack")
public class AppPatrolTrack implements Serializable {
    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键id,由app端自己生成的uuid")
    @NotNull(message = "轨迹id不能为空")
    private String id;

    /**
     * 时长
     */
    @NotBlank(message = "时长不能为空")
    private String duration;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull
    private Date startTime;

    /**
     * 结束时间
     */
    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull
    private Date endTime;

    /**
     * 距离
     */
    @NotBlank(message = "巡护距离不能为空")
    private String distance;

    /**
     * 有效时间
     */
    @ApiModelProperty(value = "有效时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date validTime;

    /**
     * 有效距离
     */
    private String validDistance;

    /**
     * 护林员ID
     */
    @NotNull(message = "护林员id不能为空")
    private Long protectorId;

    /**
     * 点集合
     */
    @NotBlank(message = "巡护点不能为空")
    private String pointCollection;

    /**
     * 巡护类型
     */
    @NotBlank(message = "巡护类型不能为空")
    private String patrolType;

    /**
     * 备注
     */
    private String remark;


    //----------------添加字段-------------------//

    /**
     * 子任务状态
     */
    @ApiModelProperty(value = "子任务状态")
    private String status;


    @ApiModelProperty(value = "是否逾期 0未预期 1已预期")
    private Integer isDelay;

    /**
     * 护林员姓名
     */
    @ApiModelProperty(value = "护林员姓名")
    private String protectorName;

    @ApiModelProperty(value = "停留时长")
    private String pauseDuration;

    @ApiModelProperty(value = "子任务id")
    private Long subTaskId;

    @ApiModelProperty(value = "主任务id")
    @TableField(exist = false)
    private Long taskId;

    private static final long serialVersionUID = 1L;
}